<?php

namespace easydis\APSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Service
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="easydis\APSBundle\EntityRepository\ServiceRepository")
 */
class Service
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="lib", type="string")
     */
    private $lib;

    /**
     * @var integer
     *
     * @ORM\Column(name="numTri", type="integer")
     */
    private $numTri;

    /**
     * @var integer
     *
     * @ORM\Column(name="productif", type="integer")
     */
    private $productif;
    
    /**
     * @var honly
     *
     * @ORM\Column(name="honly", type="integer", options={"default" = 0})
     */
    private $honly;

    /**
     * @ORM\ManyToMany(targetEntity="\easydis\APSBundle\Entity\GroupeService", cascade={"persist"})
     */
    private $groupe_services;

    public function __construct() {
        $this->groupe_services = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * @param easydis\APSBundle\Entity\GroupeService $gs
     */
    public function addGroupeServices($gs) {
        // Si l'objet fait déjà partie de la collection on ne l'ajoute pas
        if (!$this->groupe_services->contains($gs)) {
            $this->groupe_services->add($gs);
        }
    }
 
    /**
     * @return ArrayCollection $groupe_services
     */
    public function getGroupe_services() {
        return $this->groupe_services;
    }
	
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set lib
     *
     * @param string $lib
     * @return service
     */
    public function setLib($lib)
    {
        $this->lib = $lib;
    
        return $this;
    }

    /**
     * Get lib
     *
     * @return string 
     */
    public function getLib()
    {
        return $this->lib;
    }

    /**
     * Set numTri
     *
     * @param integer $numTri
     * @return service
     */
    public function setNumTri($numTri)
    {
        $this->numTri = $numTri;
    
        return $this;
    }

    /**
     * Get numTri
     *
     * @return integer 
     */
    public function getNumTri()
    {
        return $this->numTri;
    }

    /**
     * Set productif
     *
     * @param integer $productif
     * @return service
     */
    public function setProductif($productif)
    {
        $this->productif = $productif;
    
        return $this;
    }

    /**
     * Get productif
     *
     * @return integer 
     */
    public function getProductif()
    {
        return $this->productif;
    }
    
    /**
     * Set honly
     *
     * @param integer $honly
     * @return service
     */
    public function setHonly($honly)
    {
        $this->honly = $honly;
    
        return $this;
    }

    /**
     * Get honly
     *
     * @return integer 
     */
    public function getHonly()
    {
        return $this->honly;
    }
}
